package hu.mapro.gwtui.gxt.client.fieldseditor.field;

import hu.mapro.model.Getter;
import hu.mapro.model.Setter;
import hu.mapro.model.meta.Field;
import hu.mapro.model.meta.HasLabel;


public class Adapter<T, F extends Field&HasLabel&Getter<T, ?>&Setter<T, ?>> implements
		hu.mapro.gwtui.gxt.client.fieldseditor.Interface<T, F> {
	
	Interface<F> mainInterface;

	public Adapter(Interface<F> mainInterface) {
		super();
		this.mainInterface = mainInterface;
	}

	@Override
	public <V> hu.mapro.gwtui.gxt.client.fieldseditor.EditorFieldInterface<T, V> createEditorField(
			final F field) {
		final EditorFieldInterface<V> delegate = mainInterface.createEditorField(field);
		
		return new EditorFieldAdapter<T, V, F>(delegate, field);
	}


}